#ifndef PRIORITY_H
#define PRIORITY_H
#include <iostream>
#include <vector>
using namespace std;

template <class Comparable>
class BinaryHeap
{
  public:
  	explicit BinaryHeap(int capacity = 100);

	bool isEmpty() const;
	bool isFull() const;
	const Comparable & findMin() const;

	void insert(const Comparable &x);
	void deleteMin();
	void deleteMin(Comparable & minItem);
	void makeEmpty();
	Comparable & operator[](const int i);
  private:
  	int currentSize;
	int capacity;
	vector<Comparable> array;

	void buildHeap();
	void percolateDown(int hole);
};
#endif
